Add ERR_TUN_ACTIVE_TIMEOUT squid code for tunnel timeouts#12786
Add ERR_TUN_ACTIVE_TIMEOUT squid code for tunnel timeouts#12786bryancall wants to merge 3 commits intoapache:masterfrom
Conversation
Add new SquidLogCode to identify when CONNECT tunnels time out due to active timeout. This makes tunnel timeouts visible in access logs via the crc (cache result code) field. Previously, tunnel timeouts were not distinguishable in logs - users could only see them in DEBUG logs. Now the access log will show crc=ERR_TUN_ACTIVE_TIMEOUT for timed-out tunnels. Includes autotest to verify the squid code is logged correctly.
There was a problem hiding this comment.
Pull request overview
This PR adds a new squid log code ERR_TUN_ACTIVE_TIMEOUT to identify when CONNECT tunnels time out due to active timeout, making these events visible in access logs via the crc (cache result code) field.
Key Changes:
- Add
ERR_TUN_ACTIVE_TIMEOUT = 'T'enum value for tunnel active timeouts - Set the squid code in SSL tunnel handlers when
VC_EVENT_ACTIVE_TIMEOUToccurs - Include comprehensive test coverage to verify the logging behavior
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| include/proxy/hdrs/HTTP.h | Adds new ERR_TUN_ACTIVE_TIMEOUT enum value to SquidLogCode |
| src/proxy/http/HttpSM.cc | Sets the squid code in SSL tunnel producer and consumer handlers on active timeout events |
| src/proxy/logging/Log.cc | Updates the log field alias table to include the new squid code string mapping |
| tests/gold_tests/timeout/tunnel_timeout_client.py | Provides test client that establishes CONNECT tunnel and holds it idle to trigger timeout |
| tests/gold_tests/timeout/tunnel_active_timeout.test.py | Test case that verifies ERR_TUN_ACTIVE_TIMEOUT is logged for tunnel timeouts |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Add proxy.config.log.max_secs_per_buffer=1 to force log flush - Add delay test run to wait for log file to be written - Remove unused 'import time' from client script
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@bryancall make sure this change doesn't brake traffic_logstats |
Add ERR_TUN_ACTIVE_TIMEOUT to both switch statements in logstats.cc so tunnel timeouts are correctly counted in the errors bucket instead of silently falling through the default case. Clean up tunnel_timeout_client.py: remove unused time import and use socket context manager instead of manual try/finally/close.
Add new SquidLogCode to identify when CONNECT tunnels time out due to active timeout. This makes tunnel timeouts visible in access logs via the crc (cache result code) field.
Problem:
Previously, tunnel timeouts were not distinguishable in logs - users could only see them in DEBUG logs.
Solution:
ERR_TUN_ACTIVE_TIMEOUT = 'T'to SquidLogCode enumtunnel_handler_ssl_producer()andtunnel_handler_ssl_consumer()onVC_EVENT_ACTIVE_TIMEOUTResult:
Access logs now show
crc=ERR_TUN_ACTIVE_TIMEOUTfor timed-out CONNECT tunnels.Testing:
Includes autotest
tunnel_active_timeout.test.pythat verifies the squid code is logged correctly.